home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
apps
/
astronmy
/
strchart.arc
/
patch.arc
/
planet.dif
< prev
next >
Wrap
Text File
|
1989-03-23
|
18KB
|
598 lines
*** ../starchart/planet.c Mon Sep 19 09:11:43 1988
--- planet.c Mon Sep 26 08:00:31 1988
***************
*** 45,57 ****
#include <stdio.h>
#include <math.h>
#ifndef SYSV
#include <sys/time.h> /* for getting current GMT (generic Unix) */
#else
#include <time.h> /* for getting current GMT (sysV version) */
#endif
! #define CURYEAR 1987 /* default year -- needs to be maintained */
#ifndef PLANETFILE
#define PLANETFILE "./planet.star"
--- 45,62 ----
#include <stdio.h>
#include <math.h>
+ #ifdef ST_MWC /* Mark Williams C for the Atari ST */
+ #define SYSV /* MWC is almost SYSV compatible */
+ #include <osbind.h> /* Needed for Cconws() and Crawcin() */
+ #endif /* ST_MWC */
+
#ifndef SYSV
#include <sys/time.h> /* for getting current GMT (generic Unix) */
#else
#include <time.h> /* for getting current GMT (sysV version) */
#endif
! #define CURYEAR 1989 /* default year -- needs to be maintained */
#ifndef PLANETFILE
#define PLANETFILE "./planet.star"
***************
*** 68,73 ****
--- 73,84 ----
#define MAGURA 590
#define MAGNEP 800
+ #ifdef ST_MWC
+ #define daylight tt.tm_isdst
+ extern char *getenv(); /* used to see if we're running from the desktop */
+ struct tm_t *tt;
+ #endif /* ST_MWC */
+
double pie, rad;
double htod(), atof(), kepler(), truean();
double longi(), lati(), poly(), aint(), range();
***************
*** 119,125 ****
--- 130,138 ----
gettimeofday(&tv, &tz);
return(GMT1970 + tv.tv_sec/SECSPERDAY);
#else
+ #ifndef ST_MWC
long time();
+ #endif /* ST_MWC */
return(GMT1970 + (double)time((long *)0)/SECSPERDAY);
#endif
}
***************
*** 201,207 ****
aa1 = (int) (year/100);
bb1 = 2 - aa1 + (int)(aa1/4);
jd = aint(365.25*year) + aint(30.6001*(month + 1));
! jd = jd + day + 1720994.5;
if((year + month/100) > 1582.10) jd = jd + bb1;
return(jd);
}
--- 214,220 ----
aa1 = (int) (year/100);
bb1 = 2 - aa1 + (int)(aa1/4);
jd = aint(365.25*year) + aint(30.6001*(month + 1));
! jd += day + 1720994.5;
if((year + month/100) > 1582.10) jd = jd + bb1;
return(jd);
}
***************
*** 218,224 ****
--- 231,243 ----
double N,D,epli,thapp,omeg;
double nu2,P,Q,S,V,W,ze,l1pert,epert,w1pert,apert;
double psi,H,G,eta,th;
+ #ifdef ST_MWC
+ time_t now;
+ now = time((long) 0);
+ tt = localtime(&now);
+ #endif /* ST_MWC */
+
#define WRITEMODE "w"
#define OPENFAIL 0
progname = argv[0];
***************
*** 321,327 ****
RA = atan2(N,D)/rad;
DEC = asin(sin(epli*rad)*sin(thapp*rad))/rad;
speak(RA,DEC,Sr, MAGSOL, "PS", "Sol");
! /* tansformation of coordinates on Mercury and output */
trans(r,b,ll,Stheta,Sr,epli, MAGMER, "PM", "Mercury");
/* Now start on Venus */
--- 340,346 ----
RA = atan2(N,D)/rad;
DEC = asin(sin(epli*rad)*sin(thapp*rad))/rad;
speak(RA,DEC,Sr, MAGSOL, "PS", "Sol");
! /* transformation of coordinates on Mercury and output */
trans(r,b,ll,Stheta,Sr,epli, MAGMER, "PM", "Mercury");
/* Now start on Venus */
***************
*** 373,380 ****
radpert = 0.000022501 * cos((2*M-2*M2-58.208)*rad)
+0.000019045 * cos((3*M-3*M2+92.577)*rad)
+0.000006887 * cos((M5-M2-118.090)*rad)
! +0.000005172 * cos((M-M2-29.110)*rad)
! +0.000003620 * cos((5*M-4*M2-104.208)*rad)
+0.000003283 * cos((4*M-4*M2+63.513)*rad)
+0.000003074 * cos((2*M5-2*M2-55.167)*rad);
r = r + radpert;
--- 392,399 ----
radpert = 0.000022501 * cos((2*M-2*M2-58.208)*rad)
+0.000019045 * cos((3*M-3*M2+92.577)*rad)
+0.000006887 * cos((M5-M2-118.090)*rad)
! +0.000005172 * cos((M-M2-29.110)*rad);
! radpert+= 0.000003620 * cos((5*M-4*M2-104.208)*rad)
+0.000003283 * cos((4*M-4*M2+63.513)*rad)
+0.000003074 * cos((2*M5-2*M2-55.167)*rad);
r = r + radpert;
***************
*** 425,432 ****
lonpert = 0.00705*cos((M5-M4-48.958)*rad)
+0.00607*cos((2*M5-M4-188.350)*rad)
+0.00445*cos((2*M5-2*M4-191.897)*rad)
! +0.00388*cos((M-2*M4+20.495)*rad)
! +0.00238*cos((M-M4+35.097)*rad)
+0.00204*cos((2*M-3*M4+158.638)*rad)
+0.00177*cos((3*M4-M2-57.602)*rad)
+0.00136*cos((2*M-4*M4+154.093)*rad)
--- 444,451 ----
lonpert = 0.00705*cos((M5-M4-48.958)*rad)
+0.00607*cos((2*M5-M4-188.350)*rad)
+0.00445*cos((2*M5-2*M4-191.897)*rad)
! +0.00388*cos((M-2*M4+20.495)*rad);
! lonpert+= 0.00238*cos((M-M4+35.097)*rad)
+0.00204*cos((2*M-3*M4+158.638)*rad)
+0.00177*cos((3*M4-M2-57.602)*rad)
+0.00136*cos((2*M-4*M4+154.093)*rad)
***************
*** 445,452 ****
radpert+= 0.000007914*cos((3*M5-2*M4-139.737)*rad)
+0.000007004*cos((2*M5-3*M4-102.888)*rad)
+0.000006620*cos((M-2*M4+113.202)*rad)
! +0.000004930*cos((3*M5-3*M4-76.243)*rad)
! +0.000004693*cos((3*M-5*M4+190.603)*rad)
+0.000004571*cos((2*M-4*M4+244.702)*rad)
+0.000004409*cos((3*M5-M4-115.828)*rad);
r = r + radpert;
--- 464,471 ----
radpert+= 0.000007914*cos((3*M5-2*M4-139.737)*rad)
+0.000007004*cos((2*M5-3*M4-102.888)*rad)
+0.000006620*cos((M-2*M4+113.202)*rad)
! +0.000004930*cos((3*M5-3*M4-76.243)*rad);
! radpert+= 0.000004693*cos((3*M-5*M4+190.603)*rad)
+0.000004571*cos((2*M-4*M4+244.702)*rad)
+0.000004409*cos((3*M5-M4-115.828)*rad);
r = r + radpert;
***************
*** 507,513 ****
-(0.003083 + 0.000275*nu2 - 0.000489*nu2*nu2)*sin(2*V)
+0.002472*sin(W)
+0.013619*sin(ze)
! +0.018472*sin(2*ze)
+0.006717*sin(3*ze)
+0.002775*sin(4*ze)
+(0.007275 - 0.001253*nu2)*sin(ze)*sin(Q)
--- 526,533 ----
-(0.003083 + 0.000275*nu2 - 0.000489*nu2*nu2)*sin(2*V)
+0.002472*sin(W)
+0.013619*sin(ze)
! +0.018472*sin(2*ze);
! l1pert = l1pert
+0.006717*sin(3*ze)
+0.002775*sin(4*ze)
+(0.007275 - 0.001253*nu2)*sin(ze)*sin(Q)
***************
*** 519,525 ****
-(0.035681 + 0.001208*nu2)*sin(ze)*cos(Q)
-0.004261*sin(2*ze)*cos(Q)
+0.002178*cos(Q)
! +(-0.006333 + 0.001161*nu2)*cos(ze)*cos(Q)
-0.006675*cos(2*ze)*cos(Q)
-0.002664*cos(3*ze)*cos(Q)
-0.002572*sin(ze)*sin(2*Q)
--- 539,546 ----
-(0.035681 + 0.001208*nu2)*sin(ze)*cos(Q)
-0.004261*sin(2*ze)*cos(Q)
+0.002178*cos(Q)
! +(-0.006333 + 0.001161*nu2)*cos(ze)*cos(Q);
! l1pert = l1pert
-0.006675*cos(2*ze)*cos(Q)
-0.002664*cos(3*ze)*cos(Q)
-0.002572*sin(ze)*sin(2*Q)
***************
*** 532,538 ****
-.0006764*sin(ze)*sin(Q)
-.0001110*sin(2*ze)*sin(Q)
-.0000224*sin(3*ze)*sin(Q)
! -.0000204*sin(Q)
+(.0001284 + .0000116*nu2)*cos(ze)*sin(Q)
+.0000188*cos(2*ze)*sin(Q)
+(.0001460 + .0000130*nu2)*sin(ze)*cos(Q)
--- 553,560 ----
-.0006764*sin(ze)*sin(Q)
-.0001110*sin(2*ze)*sin(Q)
-.0000224*sin(3*ze)*sin(Q)
! -.0000204*sin(Q);
! epert = epert
+(.0001284 + .0000116*nu2)*cos(ze)*sin(Q)
+.0000188*cos(2*ze)*sin(Q)
+(.0001460 + .0000130*nu2)*sin(ze)*cos(Q)
***************
*** 544,550 ****
+.0000508*cos(3*ze)*cos(Q)
+.0000230*cos(4*ze)*cos(Q)
+.0000108*cos(5*ze)*cos(Q)
! -(.0000956 + .0000073*nu2)*sin(ze)*sin(2*Q)
+.0000448*sin(2*ze)*sin(2*Q)
+.0000137*sin(3*ze)*sin(2*Q)
+(-.0000997 + .0000108*nu2)*cos(ze)*sin(2*Q)
--- 566,573 ----
+.0000508*cos(3*ze)*cos(Q)
+.0000230*cos(4*ze)*cos(Q)
+.0000108*cos(5*ze)*cos(Q)
! -(.0000956 + .0000073*nu2)*sin(ze)*sin(2*Q);
! epert = epert
+.0000448*sin(2*ze)*sin(2*Q)
+.0000137*sin(3*ze)*sin(2*Q)
+(-.0000997 + .0000108*nu2)*cos(ze)*sin(2*Q)
***************
*** 554,560 ****
+(-.0000956 +.0000099*nu2)*sin(ze)*cos(2*Q)
+.0000490*sin(2*ze)*cos(2*Q)
+.0000158*sin(3*ze)*cos(2*Q)
! +.0000179*cos(2*Q)
+(.0001024 + .0000075*nu2)*cos(ze)*cos(2*Q)
-.0000437*cos(2*ze)*cos(2*Q)
-.0000132*cos(3*ze)*cos(2*Q);
--- 577,584 ----
+(-.0000956 +.0000099*nu2)*sin(ze)*cos(2*Q)
+.0000490*sin(2*ze)*cos(2*Q)
+.0000158*sin(3*ze)*cos(2*Q)
! +.0000179*cos(2*Q);
! epert = epert
+(.0001024 + .0000075*nu2)*cos(ze)*cos(2*Q)
-.0000437*cos(2*ze)*cos(2*Q)
-.0000132*cos(3*ze)*cos(2*Q);
***************
*** 562,568 ****
w1pert = (0.007192 - 0.003147*nu2)*sin(V)
+(-0.020428 - 0.000675*nu2 + 0.000197*nu2*nu2)*cos(V)
+(0.007269 + 0.000672*nu2)*sin(ze)*sin(Q)
! -0